package org.grapes.wine.api.client.method.impl;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.grapes.wine.api.bean.GetAdjoinedLandscapeLocationBean;
import org.grapes.wine.api.client.exception.WineException;
import org.grapes.wine.api.method.EWineMethod;
import org.grapes.wine.api.method.iface.IMethodGetAdjoinedLandscapeLocation;
import org.xml.sax.SAXException;

public class MethodGetAdjoinedLandscapeLocation extends CallWineMethod
		implements IMethodGetAdjoinedLandscapeLocation {

	public MethodGetAdjoinedLandscapeLocation(String apiId, String sessionKey, String sig, String serverUrl) {
		super(apiId, sessionKey, sig, serverUrl);
	}

	public String getAdjoinedLandscapeLocation(String adjoinedLandscapeName) {
		Map param = new HashMap();
		param.put("adjoinedLandscapeName", adjoinedLandscapeName);
		try {
			GetAdjoinedLandscapeLocationBean bean = (GetAdjoinedLandscapeLocationBean) callMethod(
					EWineMethod.GET_ADJOINED_LANDSCAPE_LOCATION, param);
			return bean.getAdjoinedLandscapeLocation();
		} catch (WineException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SAXException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
